<?
// *************************************
// * user.php allows the admin to
// * View and Delete admin users.
// *************************************
define('SITE_AREA', 'users');
$jsFile = 'jsUsers.js';
require_once('includes/appInit.php');
include('includes/ajax/ajaxUsers.php');
require_once('includes/header.php');
?>
<div id="formDiv">
	<div id="formNewUser" class="blueBox" style="display: none;">		
		<input type="hidden" id="formAction" />
		<input type="hidden" id="uID" />
		<input type="hidden" id="activePanel" />
		<input type="hidden" id="formType" />
		
		<p id="nameContainer"><label class="vertLabelSmall">Name</label>
		<input type="text" style="width: 195px; margin-right: 5px;" value="First Name" id="uNameFirst" name="uNameFirst" onFocus="this.value='';" />
		<input type="text" style="width: 195px;" value="Last Name" id="uNameLast" name="uNameLast" onFocus="this.value='';"  />
		</p>
		
		<p id="emailContainer"><label class="vertLabelSmall">Email Address</label>
		<input type="text" style="width: 400px;" id="uEmail" name="uEmail" /></p>
		
		<p id="phoneContainer"><label class="vertLabelSmall">Phone Number</label>
		<input type="text" style="width: 400px;" id="uPhone" name="uPhone" /></p>
		
		<p id="ptiContainer"><label class="vertLabelSmall">PTI Affiliation</label>
		<input type="text" style="width: 400px;" id="uPTI" name="uPTI" /></p>
		
		<p id="userLevelContainer"><label class="vertLabelSmall">User Level</label>
			<select size="1" style="width: 200px;" id="uUserLevel">
			<option>Select...</option>
			<option></option>
			<?
			// Render user levels
			for($a=1;$a<=count($userLevelArray);$a++) {
				echo '<option value="'.$a.'">'.$userLevelArray[$a].'</option>';
			}
			?>
			</select>				
		</p>
					
		<p id="userNameContainer"><label class="vertLabelSmall">User Name</label>
		<input type="text" style="width: 400px;" id="uUserName" name="uUserName" /></p>
		
		<p id="passwordContainer"><label class="vertLabelSmall">Password</label>
		<input type="text" style="width: 400px;" id="uPassword" name="uPassword" /></p>
			
		<p id="passwordConfirmContainer"><label class="vertLabelSmall">Confirm Password</label>
		<input type="text" style="width: 400px;" id="uPasswordConfirm" name="uPasswordConfirm" /></p>
										
		<div style="float: left; margin-left: 5px; margin-right: 5px;">
			<a href="#" class="coolButton buttonBGBlueGray" tabindex="30" onClick="usersObj.saveUser(); return false;"><span class="save">Save</span></a>
		</div>
		<div style="float: left;">
			<a href="#" class="coolButton buttonBGRed" tabindex="30" onClick="usersSupportObj.cancelUser(); return false;"><span class="cancel">Cancel</span></a>
		</div>
		<div style="clear: left;"></div>				
				
		<select size="1" id="uUserLevelForGrid" style="display: none;">				
			<option>Select...</option>
			<option></option>
			<?
			// Render user levels
			for($a=1;$a<=count($userLevelArray);$a++) {
				echo '<option value="'.$userLevelArray[$a].'">'.$userLevelArray[$a].'</option>';
			}
			?>
		</select>		
	</div>
</div>
	
<div id="content0" style="padding: 10px; width: 850px;" class="x-layout-inactive-content">
	<div id="userForm0"></div>
	<div id="buttonNew0" style="float: left; width: 180px;">
		<a href="#" class="coolButton buttonBGBlueGray" onClick="usersSupportObj.openNewUserForm(0); return false;"><span class="add">New User</span></a>
	</div>
	<div id="statusDiv0" style="float: left; height: 30px;"></div>
	<div style="clear: left; height: 10px;"></div>
	
	<div><h1><?=$_SESSION['org']; ?> Staff Users</h1></div>		
	<div id="userGrid"></div>
</div>
<div id="content1" style="display: none; padding: 10px; width: 700px;" class="x-layout-inactive-content">
	<div id="userForm1"></div>
	<div id="buttonNew1" style="float: left; width: 180px;">
		<a href="#" class="coolButton buttonBGBlueGray" onClick="usersSupportObj.openNewUserForm(1); return false;"><span class="add">New User</span></a>
	</div>
	<div id="statusDiv1" style="float: left; height: 30px;"></div>
	<div style="clear: left; height: 10px;"></div>
	
	<div><h1>PTI Resource Share Users</h1></div>
	<div id="resourceShareUserGrid"></div>
</div>	
	<div id="south"></div>  
<? include("includes/footer.php"); ?>